package scala.pattern

/**
 * 匹配集合 方式二
 */
object MatchListTest1 {
  def main(args: Array[String]): Unit = {
    val list: List[Int] = List(1, 2, 5, 6, 7)
    list match {
      case first:: second:: rest=> println(first+"_"+second+"_"+rest)
      case _=> println()
    }
  }
}
